<template>
	<view class="payment-index">
		<view class="payment-header flex-between-center">
			<view class="">
				<view class="font-s-16 fw-b">转账给<text class="mar-l-10">度小花平台</text></view>
				<view class="font-s-12 color-999 mar-t-8">此次转账类型：{{type==1?'担保金':'本息'}}</view>
			</view>
			<static-image src="/pagesA/static/img/payment/logo.png" width="88" height="88"></static-image>
		</view>
		<view class="payment-content">
			<view class="">转账金额</view>
			<view class="input-box">
				<text class="unit-text">￥</text>
				<text class="money-text" :class="{'inputing': money}">{{ money || '请输入转账金额'}}</text>
			</view>
		</view>
		<mono-keyboard :dark="false" @change="getNumber" @confirm="conform"></mono-keyboard>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 1,
				money: ''
			}
		},
		onLoad(e) {
			this.type = e.type || 1
		},
		methods: {
			getNumber(e){
				this.money = e
			},
			conform(e){
				if(this.$common.isWeChat()){
					this.$u.toast('请用支付宝扫码');
				}else{
					uni.showLoading({
						mask:true
					})
					this.$request({
						url: this.type==1?'/selfRandomPay/selfRandomPayAssure':'/selfRandomPay/selfRandomPayBen',
						method: 'post',
						data:{orderAmount:this.money}
					}).then(res => {
						window.location.href = res.data.payInfo
					})
				}
			}
		}
	}
</script>
<style>
	page{
		background-color: #ffffff;
	}
</style>
<style lang="scss" scoped>
	.payment-index {
		.payment-header{
			background-color: #f5f7fa;
			padding: 56rpx 24rpx 86rpx;
		}
		.payment-content{
			background-color: #ffffff;
			position: relative;
			z-index: 2;
			margin-top: -32rpx;
			border-radius: 32rpx 32rpx 0 0;
			padding: 32rpx 48rpx;
			.input-box{
				margin-top: 24rpx;
				border-bottom: 1px solid #F5F5F5;
				height: 120rpx;
				display: flex;
				align-items: center;
				.unit-text{
					font-weight: bold;
					font-size: 48rpx;
					position: relative;
					top: 4rpx;
				}
				.money-text{
					font-size: 48rpx;
					margin-left: 8rpx;
					color: #999;
					&.inputing{
						color: #1f1f1f;
						font-weight: bold;
						font-size: 62rpx;
					}
				}
			}
		}
	}
</style>
